import Vue from 'vue'
// import VeeValidate from 'vee-validate'
import zh_CN from 'vee-validate/dist/locale/zh_CN'

Vue.use(VeeValidate)

// 3). 提示信息本地化vee-validate/dist/locale/zh_CN
    VeeValidate.Validator.localize('zh_CN', {
      messages: zh_CN.messages,
      attributes: {
        phone: '手机号',
        code: '验证码',
        username: '登录账号',
        pwd: '密码',
        captcha: '验证码'
      }
    })

// 4). 自定义验证规则
    VeeValidate.Validator.extend('mobile', {
      validate: value => {
        return /^1\d{10}$/.test(value)
      },
      getMessage: field => field + '必须是11位手机号码'
    })